/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

package com.moltos.parser;

import java.io.File;
import java.util.List;

/**
 *
 * @author MoLt1eS
 */


class T1 implements Runnable {
    Chat m;
    File dir = new File("./chat");
    File[] saves = dir.listFiles();
    ChatParser cp = new ChatParser(saves[1]);
    List<String> s1 = cp.getLines();

    public T1(Chat m1) {
        this.m = m1;
        
        new Thread(this, "Question").start();
    }

    public void run() {
        for (int i = 0; i < s1.size(); i++) {
            m.Question(s1.get(i));
        }
    }
}

class T2 implements Runnable {
    Chat m;
    //String[] s2 = { "Hi", "I am good, what about you?", "Great!" };
    File dir = new File("./chat");
    File[] saves = dir.listFiles();
    ChatParser cp = new ChatParser(saves[0]);
    List<String> s2 = cp.getLines();
    public T2(Chat m2) {
        this.m = m2;
        new Thread(this, "Answer").start();
    }

    public void run() {
        for (int i = 0; i < s2.size(); i++) {
            m.Answer(s2.get(i));
        }
    }
}
class TestAThread {
    public static void main(String[] args) {
        Chat m = new Chat();
//        new T1(m);
//        new T2(m);
        
        File dir = new File("./chat");
        File[] saves = dir.listFiles();
        ChatParser cp = new ChatParser(saves[1]);
        List<String> s2 = cp.getLines();
        ChatBot n1 = new ChatBot(m, s2);
        cp = new ChatParser(saves[0]);
        s2 = cp.getLines();
        ChatBot n2 = new ChatBot(m, s2);
    }
}